package com.lijiajia.cloud.authserver.security.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutHandler;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 用户登出 处理器
 *
 * @author lijiajia
 * @since 2019-05-17
 */
@Slf4j
@Component
public class LogLogoutHandler implements LogoutHandler {

    @Override
    public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
        // 记录登出日志
        // mq.send
        log.debug("user logout :{}", authentication);
    }
}
